home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / CUCD / Programming / JForth / Extras / SysGen / libdefs < prev    next >
Encoding:
Text File  |  1992-01-13  |  6.1 KB  |  169 lines

  1. \ Define all 15 resident libs...
  2. \
  3. \ 06/12/88 mdh added rehash, changed name to :Library
  4. \ MOD: PLB 1/11/89 Changed MathIEESingBas to MathIEEEDoubTrans
  5. \ MOD: PLB/MDH 1/19/90 Removed CONSOLE, TIMER and POTGO since they
  6. \      are not libraries.
  7. \ 00003 09-feb-91 mdh  Allowed LIB? to not QUIT if open fail, if
  8. \                      new variable LIB_QUIT is false (default true)
  9. \                      (caller should check ???_LIB var upon return)
  10. \ 00004 15-aug-91 mdh/plb added 2.0 libs
  11. \ 00005 13-jan-92 mdh     changed wb to workbench
  12.  
  13.  
  14. : :Library   ( -- , build a JForth Library structure for handling calls )
  15.   bl word  ( here -- ) >r  unword
  16.   $" _LIB"  count r>  $append   here find swap drop 0=
  17.   IF     skip-word  [compile] variable ( globals )
  18.   THEN
  19.   bl word  ( here -- ) >r  unword
  20.   $" _NAME" count r>  $append   [compile] ((create))
  21.   COMPILE ($")  bl word  ( Put string into dictionary. )  >r
  22.   r 1+  r c@ 0           ( switch string to lower case )
  23.   DO   dup c@ ?letter
  24.        IF  dup c@   bl or over c!
  25.        THEN  1+
  26.   LOOP drop
  27.   0" .library" 1-  count  r@  $append
  28.   r>   c@ 1+ even-up allot   compile 1+
  29. $ 4e75 w,  unsmudge  [compile] [
  30.   last-sfa   $ 4000,0000  or  swap !  rehash  ;
  31.  
  32. :Library exec
  33. :Library clist
  34. :Library graphics
  35. :Library layers
  36. :Library intuition
  37. :Library mathffp
  38. :Library mathtrans
  39. :Library mathieeedoubbas
  40. :Library dos
  41. :Library translator
  42. :Library icon
  43. :Library diskfont
  44. :Library mathieeedoubtrans
  45.  
  46. :Library asl
  47. :Library battclock
  48. :Library battmem
  49. :Library commodities
  50. :Library romboot
  51. :Library cstrings
  52. :Library misc
  53. :Library rexxsyslib
  54. :Library utility
  55. :Library disk
  56. :Library gadtools
  57. :Library input
  58. :Library keymap
  59. :Library mathieeesingtrans
  60. :Library ramdrive
  61. :Library workbench   \ 00005
  62. :Library expansion
  63. :Library iffparse
  64. :Library mathieeesingbas
  65.  
  66. \ -------------- words to open/close libs convieniently ------------
  67.  
  68. user LibVersion
  69.  
  70. : openlib   ( name_addr -- pointer/false )
  71.   >abs  LibVersion @  ( absadr version -- )  call exec_lib openlibrary
  72.   LibVersion off   ;
  73.  
  74. : closelib  ( lib_pointer -- 0 )
  75.   call exec_lib  closelibrary          ;
  76.  
  77. variable Lib_Quit  Lib_Quit On  \ 00003
  78.  
  79. : lib?   ( _NAME-adr _LIB-adr -- , insures lib is open and var is set )
  80.   dup @ 0=  ( -- name lib flag )
  81.   IF    over  openlib  -dup
  82.         IF    ( name-adr lib-adr lib-pointer -- )   over !
  83.         ELSE  drop >r .err ." Can't open any version of "
  84.               r>  1- $type cr  Lib_Quit @ \ 00003
  85.               IF   quit                   \   "
  86.               ELSE Lib_Quit On  exit      \   "
  87.               THEN                        \ 00003
  88.         THEN
  89.   THEN  2drop  Lib_Quit On ;
  90.  
  91. : exec? ;          \ always open in JForth
  92. : dos?  ;          \ always open in JForth
  93. : clist?           ( -- )  clist_NAME            clist_LIB            lib?  ;
  94. : graphics?        ( -- )  graphics_NAME         graphics_LIB         lib?  ;
  95. : layers?          ( -- )  layers_NAME           layers_LIB           lib?  ;
  96. : intuition?       ( -- )  intuition_NAME        intuition_LIB        lib?  ;
  97. : mathffp?         ( -- )  mathffp_NAME          mathffp_LIB          lib?  ;
  98. : mathtrans?       ( -- )  mathtrans_NAME        mathtrans_LIB        lib?  ;
  99. : mathieeedoubbas? ( -- )  mathieeedoubbas_NAME  mathieeedoubbas_LIB  lib?  ;
  100. : translator?      ( -- )  translator_NAME       translator_LIB       lib?  ;
  101. : icon?            ( -- )  icon_NAME             icon_LIB             lib?  ;
  102. : diskfont?        ( -- )  diskfont_NAME         diskfont_LIB         lib?  ;
  103. : mathieeedoubtrans? ( -- )  mathieeedoubtrans_NAME
  104.       mathieeedoubtrans_LIB  lib?  ;
  105.  
  106.  
  107. : asl? ( -- ) asl_name asl_lib lib? ;
  108. : battclock? ( -- ) battclock_name battclock_lib lib? ;
  109. : battmem? ( -- ) battmem_name battmem_lib lib? ;
  110. : commodities? ( -- ) commodities_name commodities_lib lib? ;
  111. : romboot? ( -- ) romboot_name romboot_lib lib? ;
  112. : cstrings? ( -- ) cstrings_name cstrings_lib lib? ;
  113. : misc? ( -- ) misc_name misc_lib lib? ;
  114. : rexxsyslib? ( -- ) rexxsyslib_name rexxsyslib_lib lib? ;
  115. : utility? ( -- ) utility_name utility_lib lib? ;
  116. : disk? ( -- ) disk_name disk_lib lib? ;
  117. : gadtools? ( -- ) gadtools_name gadtools_lib lib? ;
  118. : input? ( -- ) input_name input_lib lib? ;
  119. : keymap? ( -- ) keymap_name keymap_lib lib? ;
  120. : mathieeesingtrans? ( -- ) mathieeesingtrans_name mathieeesingtrans_lib lib? ;
  121. : ramdrive? ( -- ) ramdrive_name ramdrive_lib lib? ;
  122. : workbench? ( -- ) workbench_name workbench_lib lib? ;   \ 00005
  123. : mathieeesingbas? ( -- ) mathieeesingbas_name mathieeesingbas_lib lib? ;
  124. : expansion? ( -- ) expansion_name expansion_lib lib? ;
  125. : iffparse? ( -- ) iffparse_name iffparse_lib lib? ;
  126.  
  127.  
  128. : -lib   ( _LIB-adr -- )
  129.   dup @ -dup
  130.   IF    call exec_lib closelibrary  ( -- retcode ) drop
  131.         0 over !
  132.   THEN  drop   ;
  133.  
  134.  
  135. : -exec  ;         \ error to close exec in JForth
  136. : -dos   ;         \ error to close dos  in JForth
  137. : -clist           ( -- )  clist_LIB            -lib  ;
  138. : -graphics        ( -- )  graphics_LIB         -lib  ;
  139. : -layers          ( -- )  layers_LIB           -lib  ;
  140. : -intuition       ( -- )  intuition_LIB        -lib  ;
  141. : -mathffp         ( -- )  mathffp_LIB          -lib  ;
  142. : -mathtrans       ( -- )  mathtrans_LIB        -lib  ;
  143. : -mathieeedoubbas ( -- )  mathieeedoubbas_LIB  -lib  ;
  144. : -translator      ( -- )  translator_LIB       -lib  ;
  145. : -icon            ( -- )  icon_LIB             -lib  ;
  146. : -diskfont        ( -- )  diskfont_LIB         -lib  ;
  147. : -mathieeedoubtrans ( -- )  mathieeedoubtrans_LIB  -lib  ;
  148.  
  149. : -asl ( -- ) asl_lib -lib ;
  150. : -battclock ( -- ) battclock_lib -lib ;
  151. : -battmem ( -- ) battmem_lib -lib ;
  152. : -commodities ( -- ) commodities_lib -lib ;
  153. : -romboot ( -- ) romboot_lib -lib ;
  154. : -cstrings ( -- ) cstrings_lib -lib ;
  155. : -misc ( -- ) misc_lib -lib ;
  156. : -rexxsyslib ( -- ) rexxsyslib_lib -lib ;
  157. : -utility ( -- ) utility_lib -lib ;
  158. : -disk ( -- ) disk_lib -lib ;
  159. : -gadtools ( -- ) gadtools_lib -lib ;
  160. : -input ( -- ) input_lib -lib ;
  161. : -keymap ( -- ) keymap_lib -lib ;
  162. : -mathieeesingtrans ( -- ) mathieeesingtrans_lib -lib ;
  163. : -ramdrive ( -- ) ramdrive_lib -lib ;
  164. : -workbench ( -- ) workbench_lib -lib ;  \ 00005
  165. : -mathieeesingbas ( -- )  mathieeesingbas_lib -lib ;
  166. : -expansion ( -- )  expansion_lib -lib ;
  167. : -iffparse ( -- )  iffparse_lib -lib ;
  168.  
  169.